<template>
    <div>
            <el-aside width="200px" style="background-color: rgb(238, 241, 246)">
                <el-menu  router :default-openeds="['1', '3']">
                <el-submenu index="1">
                    <template slot="title"><i class="el-icon-message"></i>导航一</template>
                    <el-menu-item index="grade" @click="showName('在线考试')">在线考试</el-menu-item>
                </el-submenu>
                <el-submenu index="2">
                    <template slot="title"><i class="el-icon-menu"></i>导航二</template>
                    <el-menu-item index="" @click="showName('错题记录')">错题记录</el-menu-item>
                </el-submenu>
                <el-submenu index="3">
                    <template slot="title"><i class="el-icon-setting"></i>导航三</template>
                    <el-menu-item index="" @click="showName('添加试卷')">添加试卷</el-menu-item>
                </el-submenu>
                </el-menu>
            </el-aside>
    </div>
</template>
<script>
export default {
    name:'LeftNav',
    methods:{
        showName(name){
				// 把菜单名称放进去，当成tab页的名称
				this.$store.commit('set_showName', name)
				this.$store.commit('set_role', "pass");
			}
    }
}
</script>
<style lang='stylus' scoped>

</style>